/**  
* @Title: BookBorrowServiceImpl.java  
* @Package com.ssm.demo.service.impl.bookborrow  
* @Description: TODO(用一句话描述该文件做什么)  
* @author jing Lei 
* @date 2018年12月27日  
* @version V1.0  
*/  

package com.ssm.demo.service.impl.bookborrow;

import java.util.Date;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.transaction.Transactional;
import org.springframework.stereotype.Service;
import com.ssm.demo.dao.bookborrow.IBookBorrowDao;
import com.ssm.demo.model.BookBorrow;
import com.ssm.demo.service.bookborrow.IBookBorrowService;
import com.ssm.demo.service.impl.BaseServiceImpl;
import com.ssm.demo.util.DateUtils;

/**  
* @ClassName: BookBorrowServiceImpl  
* @Description: service 实现 
* @author jing Lei  
* @date 2018年12月27日  
*    
*/
@Service
@Transactional
public class BookBorrowServiceImpl extends BaseServiceImpl<BookBorrow> implements IBookBorrowService{
	@Resource
	private IBookBorrowDao ibookBorrowDao;

	/**
	 * 
	 * 基础方法实现
	 */
	@PostConstruct
	private void postconstruct() {
		baseIdo = ibookBorrowDao;
	}

	/**
	 * 
	 * <p>
	 * Title: findByStudentId
	 * </p>
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @param studentId
	 *            学生id
	 * @return
	 * @see com.ssm.demo.dao.bookborrow.IBookBorrowDao#findByStudentId(int)
	 */
	@Override
	public List<BookBorrow> findByStudentId(int studentId) {
		return ibookBorrowDao.findByStudentId(studentId);
	}

	/**
	 * 
	 * <p>
	 * Title: findByBookId
	 * </p>
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @param bookId
	 *            书籍id
	 * @return
	 * @see com.ssm.demo.dao.bookborrow.IBookBorrowDao#findByBookId(int)
	 */
	@Override
	public List<BookBorrow> findByBookId(int bookId) {
		return ibookBorrowDao.findByBookId(bookId);
	}

	/**
	 * 
	 * <p>
	 * Title: findByBorrowDate
	 * </p>
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @param borrowDate
	 *            借书日期
	 * @return
	 * @see com.ssm.demo.dao.bookborrow.IBookBorrowDao#findByBorrowDate(java.util.Date)
	 */
	@Override
	public List<BookBorrow> findByBorrowDate(Date borrowDate) {
		String dateStr = DateUtils.dateTimeToString(borrowDate);
		return ibookBorrowDao.findByBorrowDate(dateStr);
	}

	/**
	* <p>Title: query</p>  
	* <p>Description: </p>  
	* @param queryName
	* @param queryValue
	* @return  
	* @see com.ssm.demo.service.bookborrow.IBookBorrowService#query(java.lang.String, java.lang.String)  
	*/  
	
	@Override
	public List<BookBorrow> query(String queryName, String queryValue) {
		return ibookBorrowDao.query(queryName, queryValue);
	}
}
